trigger Ann_BfUp_Tr on Announcement__c (before update) {
     Boolean isTasksCompleted = true;
     Boolean isTasksInProgress = true;
//     isTasksCompleted = true;
    for (Announcement__c Ann_c: Trigger.new) {
        Announcement__c oldAnnouncement = Trigger.oldMap.get(Ann_c.ID);
        List<A_Task__c> ATask_childs =( [SELECT Id, name, Status__c FROM A_Task__c WHERE Announcement__c = :oldAnnouncement.Id]);
        for (A_Task__c Atsk: ATask_childs){
            if (Atsk.Status__c=='Not Started'){
                isTasksCompleted = false;
                isTasksInProgress = false;
                //break;
            }
            else{
                    If(Atsk.Status__c!='Completed'){
                        isTasksCompleted = false;
                    }
            }
            
            
          
        }
        if (Ann_c.Status__c!=oldAnnouncement.Status__c ){
                if ((isTasksCompleted) || (isTasksCompleted) ){
                    Ann_c.Status__c = oldAnnouncement.Status__c;
                }  
        }
    }
}